package mysql;

import java.sql.Connection;

import org.firefly.db.util.DBInfo;
import org.firefly.db.util.DBName;
import org.firefly.db.util.DBUtils;

public class Yojoy {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Class.forName("com.mysql.jdbc.Driver");
		Connection srcConn = java.sql.DriverManager.getConnection("dbc:oracle:thin:@172.16.1.227:1521:orcl", "eadpDemo", "eplugger");
		Connection tarConn = java.sql.DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/yojoy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true", "yojoy", "123456");
		try {
			DBInfo srcInfo = new DBInfo(srcConn, "EADPDEMO", DBName.Oracle);
			DBInfo tarInfo = new DBInfo(tarConn, "yojoy", DBName.Mysql);
			DBUtils.dbConvertA2B(srcInfo, tarInfo,true);
		} finally{
			srcConn.close();
			tarConn.close();
		}
	}

}
